package cn.com.xy.sms.util;

import java.util.Map;

import org.json.JSONObject;

import cn.com.xy.sms.sdk.service.expressinfoservice.ExpressInfoService;
import cn.com.xy.sms.sdk.service.moviemessageservice.MovieMessageService;
import cn.com.xy.sms.sdk.service.msgurlservice.MsgUrlService;
import cn.com.xy.sms.sdk.service.urlpreviewservice.UrlPreviewService;

public class ParseMsgUrlManager {

	 public static String pickUrlFromMsg(String msgid,String phone,String msg,String msgtime,Map<String,String> extend){
		 return MsgUrlService.pickUrlFromMsg(msgid, phone, msg, msgtime, extend);
     }
	 
	 public static int checkValidUrl(final String msgid,final String phone,final String msg,final String url,final Map<String,String> extend){
		 return MsgUrlService.checkValidUrl(msgid, phone, msg, url, extend,null);
	 }
	 /*SDK-438 /songzhirong/2016.05.17---end---*/
	 public static int checkValidUrl(final String msgid,final String phone,final String msg,final String url,final Map<String,String> extend,final SdkCallBack sdkCallBack){
		return MsgUrlService.checkValidUrl(msgid, phone, msg, url, extend,sdkCallBack);
	 }
	 /*SDK-438 /songzhirong/2016.05.17---end---*/
	 
	/*MEIZU-1142 zhaojiangwei 20160908 start*/
	/*
	 *识别结果以JsonObject的形式CallBack出去，如:
	 * {"urls":"www.hsback.com.cn", "hasSensitive":true, "validStatus":2}
	 * urls:为短信中的url内容
	 * hasSensitive：为短信中书否有敏感字段, true: 有敏感字段, false: 无敏感字段.  
	 * validStatus：为url的校验状态, -1:校验危险, 2:检验安全, 1：未知风险,  406：未检测
	 */
	public static void checkUrlFromMsg(final String msgId, final String phoneNum, final String smsCenterNum,
			final String smsContent, final long smsReceiveTime, final SdkCallBack xyCallBack, boolean scrollFing, final Map<String, String> extend) throws Exception {
		MsgUrlService.checkUrlFromMsg(msgId, phoneNum, smsCenterNum, smsContent,smsReceiveTime, extend, xyCallBack, scrollFing );
	 }
	/*MEIZU-1142 zhaojiangwei 20160908 end*/
	
	/* RM-1374 mobaohua 20170314 start */
	public static void getUrlPreviewData(final String msgId, final String phoneNum, final String url,
            final Map<String, String> extend, final SdkCallBack xyCallBack, boolean scrollFing) throws Exception {
	    UrlPreviewService.getUrlPreviewData(msgId, phoneNum, url, extend, xyCallBack, scrollFing);
	}
	/* RM-1374 mobaohua 20170314 end */

    /* RM-1467 mobaohua 20170406 start */
	public static void getMovieMessageData(final String msgId, final String phoneNum, final String movieName,
            final Map<String, String> extend, final SdkCallBack xyCallBack, boolean scrollFing) throws Exception {
	    MovieMessageService.getMovieMessageData(msgId, phoneNum, movieName, extend, xyCallBack, scrollFing);
    }
    /* RM-1467 mobaohua 20170406 end */
	
	/* SDK-765 mobaohua 20170419 start */
    public static void getExpressInfoData(final String msgId, final String phoneNum, final String expressNum,
            final Map<String, String> extend, final SdkCallBack xyCallBack, boolean scrollFing) throws Exception {
        ExpressInfoService.getExpressInfoData(msgId, phoneNum, expressNum, extend, xyCallBack, scrollFing);
    }
    /* RSDK-765 mobaohua 20170419 end */
	
	
    public static void putUrlsResultData(String phone,Map<String, JSONObject> data,boolean clearPrev) {
        MsgUrlService.putUrlsResultData(phone, data, clearPrev);
    }
}
